<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件委派</title>
</head>

<body>
    <!--基础知识准备：事件流-->
    <ul>
        <li id="m1">选项1</li>
        <li id="m2">选项2</li>
        <li id="m3">选项3</li>
    </ul>

</body>
<script>
    //document.getElementById('m1')

    //所谓事件委派，就是通过父元素处理资源的事件监听
    let ul = document.querySelector('ul');
    ul.addEventListener('click',e =>{
        let text = e.target.innerHTML;
        console.log(text);
        
    })

</script>

</html>